package com.tianji.learning.controller;

import com.tianji.common.domain.dto.PageDTO;
import com.tianji.learning.domain.query.ReplyPageQuery;
import com.tianji.api.vo.ReplyVO;
import com.tianji.learning.service.IInteractionReplyService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * TODO
 *
 * @Author whx
 * @Date 2024/12/7 16:53
 */
@RestController
@RequestMapping("/admin/replies")
@Api(tags = "管理端回复相关接口")
public class InteractionReplyAdminController {

    @Autowired
    private IInteractionReplyService interactionReplyService;

    @GetMapping("/page")
    @ApiOperation("分页查询回答或评论列表")
    public PageDTO<ReplyVO> pageRepliesForAdmin(ReplyPageQuery query){
        return interactionReplyService.pageRepliesForAdmin(query);
    }

    @PutMapping("/{id}/hidden/{hidden}")
    @ApiOperation("隐藏或者显示问题")
    public void isHidden(@PathVariable("id")Long id, @PathVariable("hidden")Boolean hidden){
        interactionReplyService.isHidden(id, hidden);
    }

}
